
if exists(select name from sysobjects where name = 'sp_YKienGetAll')
	drop proc sp_YKienGetAll
go
/*
	Created by: Phuoc NH
	Created on: 13/05/2013 (dd/mm/yyyy)
	Description: 
	--

	File:$sql-scripts/Proc.sp_YKienGetAll.sql
*/

create proc sp_YKienGetAll
as
begin
	select a.*, b.MaSinhVien,c.TenLop from YKien a inner join TraCuuDiem.dbo.SinhVien b on a.NguoiGui=b.MaSinhVien inner join TraCuuDiem.dbo.Lop c on b.MaLop=c.MaLop where a.trangthai<>255 order by a.trangthai asc, NgayGui desc
end


